All Questions
Tagged with clean-architectureobject-oriented
14 questions
0votes
1answer
258views
Separation of concerns between business layer, data layer and presentation layer without losing information
I'm developing an api in Fast API using sqlalchemy to manage my ORM classes and operations with the database. I'm dealing with some design decisions to have my classes as little coupled as possible ...
2votes
1answer
2kviews
Clean architecture - how to manage use cases that depends on external apis
How to apply clean architecture concepts in a software that depends on External APIs. Example: A business that offers some kind of subscription to its users. Its convinient to store some subscription ...
1vote
1answer
2kviews
DDD - How to avoid validation rule duplication
From what I understand of DDD, my entities and value objects should be able to enforce its own invariants, meaning that its constructors will check for nulls, must contains numbers and letters, ...
0votes
2answers
417views
How to restrict the construction of a domain object to an external service?
I have this object RelativeFoo{int relativeCode, Origin relativeTo} And I want to map it to this other object AbsoluteFoo{int absoluteCode} In order to do this, I need to use a service whose ...
1vote
5answers
2kviews
Clean architecture, Login UseCase with OAuth breaking Single responsability principle
I'm building a login system using OAuth to integrate with various social networks. The flow is very simple, first, the user is redirected to their social network to grant permission to read the ...
0votes
1answer
119views
Should I define a separate interface for clarity rather than implementing Supplier<T>?
Let's say you have to meet some prerequisites before doing something. For that, I think implementing Supplier<Boolean> is a great candidate since it's widely used, and quick to understand. But, ...
5votes
3answers
14kviews
What is the responsibility of Infrastructure layer in a clean architecture?
I am trying to follow Clean Architecture by Uncle Bob. I have 3 layers: Core (Hosts business logic, and is the central layer) Application (Host application usecases, and is directly above the core) ...
1vote
1answer
108views
Adapt very different adapters to an Interface
I'm building a service to send push notifications to the user. At first, I designed an Interface for the push notification adapters, something like this: interface PushNotificationAdapterInterface { ...
4votes
2answers
850views
How to model classes that can be extendable?
I have recently inherited a codebase which has a weird problem and I am trying to search for an extensible solution that can solve my issue. Consider I have a model class that is used as a model to ...
-1votes
3answers
163views
Chain of responsibility look alike but choose handler at runtime
Currently I have an structure of PopUps and I've been thinking to use Chain of Responsibility pattern, but the difference is a popup can back to previous one PopUp and also can go to any other PopUp. ...
1vote
2answers
457views
Collect Data of different Modules inside a Monolith
During my first attempt of implementing a project with the "Clean Architecture" I try to implementation a job portal where I came across a problem concerning the communication between (...
1vote
5answers
3kviews
Clean code for multiple entity representations
I'm wondering what is a clean solution for representing an entity in many different format. Let's suppose I have the following entity: Person { Long id; String title; String firstName; ...
8votes
2answers
11kviews
Doesn't repository pattern in clean architecture violate Dependency inversion principle?
From what I have read and seen clean architecture assumes that you have some entities which know nothing about persistence though at the same layer as they reside there might be an interface which has ...
1vote
1answer
109views
Common Code for Transformation of an Entity
My api is exposing information centering around an entity Company. Companies are complex, and can contain Vendors directly, or can contain sub-companies which contain vendors themselves. A consumer of ...